package com.group11.base.controller;

import com.group11.base.entity.Industry;
import com.group11.base.service.IndustryService;
import com.group11.common.pojo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("industry")
public class IndustryController {
    @Autowired
    private IndustryService industryService;
    @PostMapping("list")
    public ResponseResult<List<Industry>> list() {

        return new ResponseResult<>(industryService.findAll());
    }

    @PostMapping("getById")
    public ResponseResult<Industry> getIndustryById(@RequestParam int id) {
        return new ResponseResult<>(industryService.getById(id));
    }
}
